﻿<!--
Name:提现页面
Page:All
-->
<div class="nbbox clearfix">
    <div class="userbox">
        <div class="mt clearfix">
            <h2>{tag:提现}</h2>
        </div>
        <%if(SubmitShow){ %>
        <div class="mc clearfix">
        <div class="dl-table clearfix">
        <dl>
            <dt>{tag:收款方式}：</dt>
            <dd>
            <label><input type="radio" name="PayType" value="bank" shop="true" onclick="SetType();" checked />{tag:银行转账}</label>
            <label><input type="radio" name="PayType" value="alipay" shop="true" onclick="SetType();" />{tag:支付宝}</label>
            </dd>
        </dl>
        <dl>
            <dt>{tag:姓名}：</dt>
            <dd><input type="text" name="CashAccount_Name" id="CashAccount_Name" size="30" value="" shop="true" min="notnull" class="input" /></dd>
        </dl>
        <dl>
            <dt>{tag:账号}：</dt>
            <dd><input type="text" name="CashAccount_Code" id="CashAccount_Code" size="30" value="" shop="true" min="notnull" class="input" /></dd>
        </dl>
        <dl id="DIVCashAccount_Bank">
            <dt>{tag:银行}：</dt>
            <dd><input type="text" name="CashAccount_Bank" id="CashAccount_Bank" size="30" value="" shop="true" min="notnull" class="input" /></dd>
        </dl>
        <dl>
            <dt>{tag:提现金额}(<%=DefaultCurrency.Msige %>)：</dt>
            <dd><input type="text" name="RMoney" id="RMoney" onkeyup="value=value.replace(/[^\d\.]/g,'');" value="<%=CurrentUser.Money %>" shop="true" min="notnull" class="input" />
            <em>{tag:帐户余额}((<%=DefaultCurrency.Msige %>)):<%=CurrentUser.Money %> &nbsp;&nbsp;{tag:最低提现金额}(<%=DefaultCurrency.Msige %>):<%=SYS.TakeMoneyLimit %></em></dd>
        </dl>
        <dl>
            <dt>{tag:支付密码}：</dt>
            <dd><input name="Pay_Password" id="Pay_Password" size="30" type="password" shop="true" min="notnull" class="input" /> <a href="<%=URL("P_UserQuestion","1")%>" target="_blank">{tag:忘记密码}</a></dd>
        </dl>
        <%if(SubmitShow){ %>
        <dl class="dl-btn">
            <dt></dt>
            <dd><a href="javascript:void(0)" onclick="submit();" class="btn btn-11"><s></s>{tag:提交}</a></dd>
        </dl>
        <%}else{ %>
        <dl class="dl-btn">
            <dt></dt>
            <dd>{tag:最低提现金额}(<%=DefaultCurrency.Msige %>):<%=SYS.TakeMoneyLimit %></dd>
        </dl>
        <%} %>
        </div>
        </div>
        <%}
        if(CashCount>0){ %>
            <table cellpadding="0" cellspacing="0" width="100%" class="tablemenu">
                <tr>
                    <th style="width:130px;">{tag:时间}</th>
                    <th style="width:100px;">{tag:金额}/{tag:手续费}</th>
                    <th style="width:100px;">{tag:状态}</th>
                    <th>{tag:备注}</th>
                </tr>
            </table>
            <div class="table-list loadlist">
            <%foreach (Shop.Model.Lebi_Cash o in cashs){%>
            <div class="loadli">
            <table cellpadding="0" cellspacing="0" width="100%">
            <tr>
                <td style="width:130px;"><%=FormatTime(o.Time_add) %></td>
                <td style="width:100px;"><%=FormatMoney(o.Money) %>/<%=FormatMoney(o.Fee) %></td>
                <td style="width:100px;"><%=TypeName(o.Type_id_CashStatus) %></td>
                <td><%=o.Remark %></td>
            </tr>
            </table>
            </div>
            <%} %>
            <%if (CurrentSite.IsMobile==0){ %>
                <div class="bottom clearfix"><div class="right"><%=PageString%></div></div>
            <%}else{%>
            <div class="loadpage">
                <a data-next="<%=NextPage%>"></a>
            </div>
            <script>
                $(document).ready(function () {
                    var container = document.querySelector('.loadlist');
                    var ias = $.ias({
                        container: ".loadlist",
                        item: ".loadli",
                        pagination: ".loadpage",
                        next: ".loadpage a"
                    });
                    ias.on('render', function (items) {
                        //$(items).css({ opacity: 0 });
                    });
                    ias.on("rendered", function (items) {
                    });
                    ias.extension(new IASSpinnerExtension({ html: "<div class=\"loadinginfo\"><img src=\"{src}\" />&nbsp;{Tag:加载中}</div>" }));
                    ias.extension(new IASTriggerExtension({ text: '{Tag:加载更多}', offset: 100, html: "<div class=\"loadinginfo more\"><p>{text}</p></div>" }));
                    ias.extension(new IASNoneLeftExtension({
                        text: '', html: ""
                    }));
                });
            </script>
            <%}%>
        <%} %>
    </div>
</div>
<script type="text/javascript">
    function submit() {
        var RMoney = $("#RMoney").val();
        if (RMoney == "" || RMoney<=0) {
            CheckNO("RMoney", "{tag:金额必须大于0}");
            return false;
        }
        var postData = GetFormJsonData("shop");;
        var url = path+"/ajax/ajax_userin.aspx?__Action=TackMoney";
        RequestAjax(url, postData, function (res) { MsgBox(1, "{tag:操作成功}", "?");$("#CashAccount_Name").val("");$("#CashAccount_Code").val("");$("#CashAccount_Bank").val("");$("#RMoney").val("<%=CurrentUser.Money %>"); });
    }
    function SetType() {
        var Type = $("input[name='PayType']:checked").val();
        if (Type == "alipay") {
            $("#DIVCashAccount_Bank").hide();
            $("#CashAccount_Bank").attr("min", "");
        } else {
            $("#DIVCashAccount_Bank").show();
            $("#CashAccount_Bank").attr("min", "notnull");
        }
    }
    SetType();
    function SetBank(PayType, UserName, Code, Name) {
        if (PayType == "alipay") {
            $("input[name=PayType][value='alipay']").attr("checked", true);
            $("#DIVCashAccount_Bank").hide();
            $("#CashAccount_Bank").attr("min", "");
            $("#CashAccount_Name").val(UserName);
            $("#CashAccount_Code").val(Code);
            $("#CashAccount_Bank").val("");
        } else {
            $("input[name=PayType][value='bank']").attr("checked", true);
            $("#DIVCashAccount_Bank").show();
            $("#CashAccount_Bank").attr("min", "notnull");
            $("#CashAccount_Name").val(UserName);
            $("#CashAccount_Code").val(Code);
            $("#CashAccount_Bank").val(Name);
        }
    }
    SetType();
</script>